package com.nlp.trie.statemachine;

public class Guard {
	
	/**
	 * 输入事件
	 */
	private InputEvent event;
	/**
	 * 名称
	 */
	private String label = "";
	public InputEvent getEvent() {
		return event;
	}
	public void setEvent(InputEvent event) {
		this.event = event;
	}
	public String getLabel() {
		return label;
	}
	public void setLabel(String l) {
		this.label = l;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == null || !(obj instanceof Guard)) {
			return false;
		}
		Guard other = (Guard) obj;
		return event.equals(other.event);
	}
	
	@Override
	public int hashCode() {
		int hash = 7;
		hash = 79*hash+(this.event != null? this.event.hashCode():0);
		return hash;
	}
	public boolean checkEvent(InputEvent e) {
		if (e == null) {
			return false;
		}
		if (event == null) {
			return false;
		}
		return event.equals(e);
	}
}
